import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;


public class DatabaseManager {
	public static Connection conn = null;
	
	public DatabaseManager(){}
	
	static void openConnection(){
		String DB_URL = "jdbc:mysql://localhost:3306/flappybirdv2db"; // 50.62.209.81
		String USER = "root"; // halil
		String PASS = "123"; //10101010h
		try{
		      Class.forName("com.mysql.jdbc.Driver");

		      conn = DriverManager.getConnection(DB_URL, USER, PASS);
		   }catch(SQLException se){
		      //Handle errors for JDBC
		      se.printStackTrace();
		   }catch(Exception e){
		      //Handle errors for Class.forName
		      e.printStackTrace();
		   }
	}
	static void closeConnection(){
		try {
			conn.close();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
